<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>进度条</title>
    <style>
      body {
        padding: 100px;
      }
      .box {
        width: 200px;
        height: 10px;
        background: rgba(0, 0, 0, 0.2);
        position: relative;
        border-radius: 5px;
      }
      .loading::before {
        content: " ";
        position: absolute;
        top: 0;
        left: 0;
        width: 0%;
        height: 100%;
        background: #0071e2;
        border-radius: 5px;
        animation: move-ani 2s linear infinite;
      }
      @keyframes move-ani {
        50% {
          width: 100%;
        }
        100% {
          width: 0;
          left: unset; /* 清除left属性 */
          right: 0;
        }
      }
    </style>
  </head>
  <body>
    <div class="box">
      <div class="loading"></div>
    </div>
  </body>
</html>
